<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="layui/css/layui.css" />
<script src="layui/layui.js"></script>
</head>
<body>
	<form class="layui-form" onsubmit="false">
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>ID：</label>
			<div class="layui-input-inline" style="width: 350px">
				<input type="text" name="Acid" id="Acid" required
					lay-verify="required" placeholder="" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>活动名称：</label>
			<div class="layui-input-inline" style="width: 350px">
				<input type="text" name="Acname" id="Acname" required
					lay-verify="required" placeholder="" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><span style="color: red;">*</span>结束时间：</label>
			<div class="layui-input-inline" style="width: 350px">
				<input type="text" name="Acend_time" id="Acend_time" required
					lay-verify="required" placeholder="请以2020/12/31方式输入" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><span style="color: red;">*</span>商品描述：</label>
			<div class="layui-input-inline" style="width: 350px">
				<select name="Pid" id="Pid" class="layui-input"
					lay-verify="required">
					<option value="">请选择</option>
					<c:forEach items="${shoppcar }" var="s">
					<option  value="${s.Pid }">${s.Pname }</option>
					</c:forEach>
				</select>			</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>商品名称：</label>
			<div class="layui-input-inline" style="width: 350px">
				<input type="text" name="Standby_application_one" id="Standby_application_one" required
					lay-verify="required" placeholder="" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-btn-container" style="text-align: center;">
				<button class="layui-btn" lay-submit lay-filter="formDemo">编辑</button>
			</div>
		</div>
	</form>

	<script>
	layui.use(['form','upload'], function() {
		var form = layui.form;
		var $ = layui.jquery;
			//监听提交
			form.on('submit(formDemo)', function(data) {
				var d = data.field;//表单中的数据，定义一个对象来接收
				var url = '/shoppingsix/activity-update';
				$.post(url, d, function(data) {
					console.log(data);
			          if(data.count>0){
			            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
			            parent.layer.close(index); //再执行关闭   
			          }
				}, "json");
				return false;
			});
			});
	</script>

</body>
</html>